Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fpm-alpine variant (redux) #190

Merged
merged 2 commits into from
Dec 12, 2016
Merged

Conversation

tianon
Copy link
Member

@tianon tianon commented Dec 10, 2016

Closes #129 (changes reflected here)

Here's the full diff following this PR:

diff --git a/Dockerfile-debian.template b/Dockerfile-alpine.template
index 2b39553..0bda827 100644
--- a/Dockerfile-debian.template
+++ b/Dockerfile-alpine.template
@@ -1,18 +1,30 @@
 FROM php:%%PHP_VERSION%%-%%VARIANT%%
 
+# our docker-entrypoint.sh is a bit involved
+RUN apk add --no-cache bash
+# in theory, it is POSIX-compliant, but first priority is a working, consistent image
+
 # install the PHP extensions we need
 RUN set -ex; \
        \
-       apt-get update; \
-       apt-get install -y \
-               libjpeg-dev \
-               libpng12-dev \
+       apk add --no-cache --virtual .build-deps \
+               libjpeg-turbo-dev \
+               libpng-dev \
        ; \
-       rm -rf /var/lib/apt/lists/*; \
        \
        docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
-       docker-php-ext-install gd mysqli opcache
-# TODO consider removing the *-dev deps and only keeping the necessary lib* packages
+       docker-php-ext-install gd mysqli opcache; \
+       \
+       runDeps="$( \
+               scanelf --needed --nobanner --recursive \
+                       /usr/local/lib/php/extensions \
+                       | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
+                       | sort -u \
+                       | xargs -r apk info --installed \
+                       | sort -u \
+       )"; \
+       apk add --virtual .wordpress-phpexts-rundeps $runDeps; \
+       apk del .build-deps
 
 # set recommended PHP.ini settings
 # see https://secure.php.net/manual/en/opcache.installation.php

@tianon
Copy link
Member Author

tianon commented Dec 10, 2016

Simple size comparison:

wordpress           fpm                 1f589e64cf03        4 minutes ago       401.7 MB
wordpress           fpm-alpine          174e2e2d15ff        14 minutes ago      95.41 MB

@tianon
Copy link
Member Author

tianon commented Dec 10, 2016

IMO we should review and merge docker-library/official-images#2436 before we do this one (and obviously then restart Travis here so these new variants get tested)

@tianon
Copy link
Member Author

tianon commented Dec 12, 2016

The test from docker-library/official-images#2436 caught an issue where BusyBox sed can't seem to handle some of our sed expressions, so our configuration was not being applied correctly! 👍

@tianon
Copy link
Member Author

tianon commented Dec 12, 2016

📗

@yosifkit yosifkit merged commit 92af5d8 into docker-library:master Dec 12, 2016
@yosifkit yosifkit deleted the alpine branch December 12, 2016 22:54
tianon added a commit to infosiftr/stackbrew that referenced this pull request Dec 13, 2016
- `celery`: 4.0.1
- `docker`: 1.12.4
- `elasticsearch`: add Alpine variants (docker-library/elasticsearch#149)
- `ghost`: allow arbitrary `--user` values (docker-library/ghost#54)
- `haproxy`: 1.7.1
- `java`: debian 9~b148-1
- `mariadb`: add explicit `--socket` (MariaDB/mariadb-docker#92)
- `mysql`: 5.7.17-1debian8, 5.6.35-1debian8, 5.5.54
- `openjdk`: debian 9~b148-1
- `percona`: add explicit `--socket` (docker-library/percona#37)
- `php`: move `CFLAGS` (and friends) to `PHP_CFLAGS`, add `-pie` (docker-library/php#352)
- `postgres`: 9.6.1-2.pgdg80+1, use `pgsql -f ...` instead of `pgsql < ...` for relative includes (docker-library/postgres#234)
- `rocket.chat`: 0.48.1
- `tomcat`: 8.5.9, 9.0.0.M15
- `wordpress`: add `fpm-alpine` variant (docker-library/wordpress#190)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants